package com.snail.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.snail.model.pojo.BizQuestion;
import com.snail.model.pojo.BizQuestionCollect;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author Monica
* @description 针对表【biz_question_collect(用户收藏题表)】的数据库操作Mapper
* @createDate 2025-07-16 10:22:25
* @Entity com.snail.model.pojo.BizQuestionCollect
*/
@Mapper
public interface BizQuestionCollectMapper extends BaseMapper<BizQuestionCollect> {
    @Select("""
        SELECT q.*
        FROM biz_question_collect qc
        JOIN biz_question q ON qc.question_id = q.id
        WHERE qc.collect_id = #{collectId} AND q.deleted = 0
    """)
    List<BizQuestion> getQuestionsByCollectId(@Param("collectId") Integer collectId);
}




